/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Menu;

import GUI.FrameControlDanhMuc.JIFTheLoai;
import GUI.FrameControlDanhMuc.JIFKhachHang;
import GUI.FrameControlDanhMuc.JIFSach;
import GUI.FrameControlDanhMuc.JIFTacGia;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;

/**
 *
 * @author 10520_000
 */
public class JIFDanhMuc extends javax.swing.JInternalFrame {

    private JDesktopPane desktop;
    /**
     * Creates new form JIFDanhMuc
     */
    public JIFDanhMuc() throws PropertyVetoException {
        
        this.setFrameIcon(new ImageIcon("src/Image/login.png"));
       javax.swing.plaf.InternalFrameUI gui  = this.getUI();  
            ((javax.swing.plaf.basic.BasicInternalFrameUI)gui).setNorthPane(null);
        initComponents();
       
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jPanelDanhMuc = new javax.swing.JPanel();
        jLabelTieuDe = new javax.swing.JLabel();
        jButtonKhachHang = new javax.swing.JButton();
        jButtonTacGia = new javax.swing.JButton();
        jButtonSach = new javax.swing.JButton();
        jButtonTheLoai = new javax.swing.JButton();

        jScrollPane1.setViewportView(jTree1);

        setBorder(javax.swing.BorderFactory.createEtchedBorder());
        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setMaximumSize(new java.awt.Dimension(80, 80));

        jPanelDanhMuc.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanelDanhMuc.setPreferredSize(new java.awt.Dimension(238, 288));

        jLabelTieuDe.setBackground(new java.awt.Color(255, 153, 255));
        jLabelTieuDe.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabelTieuDe.setForeground(new java.awt.Color(255, 255, 255));
        jLabelTieuDe.setText("Liệt kê danh mục");

        jButtonKhachHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/people2.png"))); // NOI18N
        jButtonKhachHang.setText("Danh sách khách hàng");
        jButtonKhachHang.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonKhachHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonKhachHangActionPerformed(evt);
            }
        });

        jButtonTacGia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/people3.png"))); // NOI18N
        jButtonTacGia.setText("Danh Sách tác giả");
        jButtonTacGia.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonTacGia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTacGiaActionPerformed(evt);
            }
        });

        jButtonSach.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/book.png"))); // NOI18N
        jButtonSach.setText("Danh sách Sách");
        jButtonSach.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonSach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSachActionPerformed(evt);
            }
        });

        jButtonTheLoai.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/list.png"))); // NOI18N
        jButtonTheLoai.setText("Danh sách thể loại");
        jButtonTheLoai.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButtonTheLoai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTheLoaiActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelDanhMucLayout = new javax.swing.GroupLayout(jPanelDanhMuc);
        jPanelDanhMuc.setLayout(jPanelDanhMucLayout);
        jPanelDanhMucLayout.setHorizontalGroup(
            jPanelDanhMucLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDanhMucLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDanhMucLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTieuDe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelDanhMucLayout.createSequentialGroup()
                        .addGroup(jPanelDanhMucLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonSach, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonTacGia, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
                            .addComponent(jButtonKhachHang, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonTheLoai, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanelDanhMucLayout.setVerticalGroup(
            jPanelDanhMucLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDanhMucLayout.createSequentialGroup()
                .addComponent(jLabelTieuDe, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonSach)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonTacGia)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonTheLoai)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonKhachHang)
                .addContainerGap(153, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 273, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelDanhMuc, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 365, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelDanhMuc, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonKhachHangActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
            desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFKhachHang frame;
        try {
            frame = new JIFKhachHang();
            frame.setVisible(true);
            getDesktop().add(frame);
            frame.setSelected(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonKhachHangActionPerformed

    private void jButtonTacGiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTacGiaActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
            desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFTacGia frame;
        frame = new JIFTacGia();
        frame.setVisible(true);
        getDesktop().add(frame);
        
    }//GEN-LAST:event_jButtonTacGiaActionPerformed

    private void jButtonSachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSachActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
            desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFSach frame;
        try {
            frame = new JIFSach();
            frame.setVisible(true);
            getDesktop().add(frame);
            frame.setSelected(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonSachActionPerformed

    private void jButtonTheLoaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTheLoaiActionPerformed
        // TODO add your handling code here:
        if(desktop.getComponentCount() != 0)
        desktop.getComponent(0).setVisible(false);
        desktop.removeAll();
        JIFTheLoai frame;
        try {
            frame = new JIFTheLoai();
            frame.setVisible(true);
            getDesktop().add(frame);
            frame.setSelected(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(JIFDanhMuc.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonTheLoaiActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonKhachHang;
    private javax.swing.JButton jButtonSach;
    private javax.swing.JButton jButtonTacGia;
    private javax.swing.JButton jButtonTheLoai;
    private javax.swing.JLabel jLabelTieuDe;
    private javax.swing.JPanel jPanelDanhMuc;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTree jTree1;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the desktop
     */
    public JDesktopPane getDesktop() {
        return desktop;
    }

    /**
     * @param desktop the desktop to set
     */
    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }
}
